<!doctype html>
<html  xmlns:th="http://www.thymeleaf.org" >
<head>
<meta charset="utf-8">
<title>组群聊-组群聊</title>
<link href="../c/base.css" rel="stylesheet" type="text/css">
<link href="../c/toefl.css" rel="stylesheet" type="text/css">
<link href="../c/bootstrap.min.css" rel="stylesheet" type="text/css">
<script src="../j/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
</head>
<style>
    .nowPage {
        color: red;
    }
</style>
<body>

<div class="openMenu">
	<div class="doc1180">
    	<ul class="fn-clear">
        	<li th:class="${session.type==null}? 'openMenuOn'"><a href="/toGroup?">全部</a></li>
        	<li th:class="${session.type==1}? 'openMenuOn'"><a href="/toGroup?group_type=1">同城考试群</a></li>
            <li th:class="${session.type==2}? 'openMenuOn'"><a href="/toGroup?group_type=2">考试场次群</a></li>
            <li th:class="${session.type==3}? 'openMenuOn'"><a href="/toGroup?group_type=3">名师学堂群</a></li>
            <li th:class="${session.type==4}? 'openMenuOn'"><a href="/toGroup?group_type=4">结伴备考群</a></li>
        </ul>
    </div>
</div>
<div class="doc1180 paddingT20 fn-clear"><!--页面左侧内容-->
    <div class="tfr_left">
        <div class="zql_item"  >
        	<ul th:each="g :${session.sess_group}">
            	<li class="zql_itemPic"><img th:src="${g.img_url}" width="82" height="82"></li>
                <li class="zql_itemText">

                		<div class="zql_itemTitle" th:text="${g.group_name}"></div>
                    	<div class="zql_itemTime">建群时间：[[${#dates.format(g.create_time,'yyyy-MM--dd')}]]</div>
                    	<div class="zql_itemP" th:text="${g.group_desc}"> 香港股市近之势停止，令不少有买股票的艺人赔钱!</div>

                </li>
                <li class="zql_itemButton">
                	<div class="zql_itemNum">[[${g.count}]]人已加入</div>
                	<div class="zql_itemZt">
                    	<a th:href="@{/toGroupDetails(id=${g.group_id})}">群信息</a>
                        <div  style="float: right" th:if="${session.loginMessage  eq 'user'}" th:switch="${session.sess_user.user_id}" >
                            <div th:each="s:${g.groupuser}">
                        <a th:case="${s.admin_id}" th:href="@{/eixtGroup(gid=${g.group_id},uid=${session.sess_user.user_id})}">退出该群</a>
                            </div>
                        </div>
                        <a th:if="${session.loginMessage eq 'teacher'}" th:href="@{/destoryGroup(gid=${g.group_id})}">解散群</a>
                        </div>
                	<a class="btn btn-primary"  onclick="tologin()"  th:if="${session.sess_user == null}" >加入群</a>
                    <div th:if="${session.loginMessage  eq 'teacher'}">
                    <a class="btn btn-success" th:if="${g.teacher.teacher_id == session.sess_user.teacher_id}" th:href="@{/tochat(id=${g.group_id})}">聊天室</a>
                    </div>
                    <div th:if="${session.loginMessage  eq 'user'}" th:switch="${session.sess_user.user_id}" >
                        <div th:each="s:${g.groupuser}">
                        <a class="btn btn-success" href="###"  th:case="${s.admin_id}" th:href="@{/tochat(id=${g.group_id})}">聊天室</a>
                        </div>
                        <a class="btn btn-primary" th:href="@{/joingroup(id=${g.group_id})}" th:case="*" >加入群</a>
                    </div>
                </li>

            </ul>
        </div>
        </form>

	</div>
    <div class="pageList">

    </div>



</div>
<script type="text/javascript">
        function joinGroup() {
                    var id =$("#idd").val();
                    window.location.href="/joingroup?id="+id;
        }

        function  tologin() {
            window.parent.location.href ="/toLogin";
        }

</script>

</body>
</html>
